package com.spider.admin.scaffold.entity.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * 树形结构
 *
 * @author xiong.bo
 * @version 1.0
 * @date 2024/7/6 10:52 上午
 */
public class TreeNode<T> {

    private T data;
    private List<TreeNode<T>> children;

    public TreeNode(T data) {
        this.data = data;
        this.children = new ArrayList<>();
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public List<TreeNode<T>> getChildren() {
        return children;
    }

    public void addChild(TreeNode<T> child) {
        children.add(child);
    }

}
